package com.hxzy.service.impl;

import com.hxzy.entity.PmsProduct;
import com.hxzy.mapper.PmsProductMapper;
import com.hxzy.service.PmsProductService;
import com.hxzy.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class PmsProductServiceImpl implements PmsProductService {
    @Override
    public List<PmsProduct> searchByCondition(PmsProduct pmsProduct) {
        List<PmsProduct> list;
        try (SqlSession session= MybatisUtil.getSqlSessionFactory().openSession()){
            PmsProductMapper mapper = session.getMapper(PmsProductMapper.class);
            list = mapper.searchByCondition(pmsProduct);
        }
        return list;
    }
}
